home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / admin / makedev-.5 / makedev- / makedev-1.5 / devices.h < prev    next >
Text File  |  1995-03-25  |  2KB  |  64 lines

  1. /*
  2.  * devices.h: header file for devices.c
  3.  *
  4.  * Written 25-Mar-95 by David A. Holland, dholland@husc.harvard.edu
  5.  *
  6.  * Copyright 1994, 1995. All rights reserved. 
  7.  * See the file LEGAL.NOTICE for conditions of redistribution.
  8.  *
  9.  * Bugs:
  10.  *    None known right now.
  11.  *
  12.  * History:
  13.  *
  14.  * Version 1    25-Mar-95       Protos for the split of makedev.syn.
  15.  */
  16.  
  17. #define YES 1
  18. #define NO 0
  19.  
  20. /*
  21.  * Proto for parser.
  22.  */
  23. void doparse(FILE *f, int filetype, const char *filename);
  24.  
  25. /*
  26.  * Data types used by both parser and devices stuff
  27.  */
  28. #define MAXTARGETS 32
  29. typedef struct {
  30.     const char *name;  /* name of batch */
  31.     const char *targets[MAXTARGETS];
  32.     int ntargets;
  33.     int busy;
  34. } batch;
  35.  
  36. /*
  37.  * Functions for parser
  38.  */
  39. void crash(const char *msg);
  40. void warn(const char *format, ...);
  41. int get_major(const char *procname, int ischar, int defaalt);
  42. void addalias(const char *procname, const char *groupname);
  43. void init(const char *name, const char *grp, const char *class,
  44.       int major, int minor, int type);
  45. void initlots(const char *base, int lo, int hi, const char *grp,
  46.           const char *class,
  47.           int maj, int baseminor, int type);
  48. void initdisk(const char *base, int low, int high, int nparts,
  49.           int maj, int minmult);
  50. void initlink(const char *name, const char *grp, const char *target);
  51. void set_major(const char *procname, int ischar, int num);
  52. void updatefromcache(const char *name, int major, int type);
  53. batch *add2batch(batch *b, const char *target);
  54. batch *addbatch(const char *name);
  55. void ignore_procname(const char *procname);
  56. void addclass(const char *name, const char *o, const char *g, int m);
  57.  
  58. /*
  59.  * Proto for main operative function.
  60.  */
  61. typedef enum { M_CREATE, M_OMIT } makeopts;
  62. void make(const char *batch_or_grp_or_devname, makeopts);
  63.  
  64.